#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import random

"随机生成一个长度10的列表"
list_var=[]
for int_var in  range(10):
        list_var.append(random.randint(0, 200))

#list_var=[13,5,4,6,7]
def list_fun( parame ):
    list_len = len(parame)
#   "遍历列表判断最大最小值"
    "冒泡排序法"
    for i in range(list_len):
        for j in range(len(parame)-(i+1)):
            if parame[j] > parame[j+1]:
                parame[j] = parame[j] + parame[j+1]
                parame[j+1] = parame[j] - parame[j+1]
                parame[j] = parame[j] - parame[j+1]
                                        
    return (parame[-1],parame[0])

print "随机列表"+":",list_var
"调用函数，并打印最大最小值"
print list_fun(list_var)